package code;

import java.util.Scanner;

public class DayTime_day15 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String day_first = sc.nextLine();
        String day_second = sc.nextLine();
        String[] first_day = day_first.split("/");
        String[] second_day = day_second.split("/");
        long total_days_1=GetTotals(first_day);
        long total_days_2=GetTotals(second_day);
        long result = total_days_2-total_days_1;
        System.out.println(result+1);
    }

    public static long GetTotals( String[] date) {
        int day=Integer.parseInt(date[2]);
        int month=Integer.parseInt(date[1]);
        int year=Integer.parseInt(date[0]);
        long total=0;
        //年
        for(int y=0;y<year;y++){
            if(Is366(y)){
                total+=366;
            }
            total+=365;
        }
        for(int m=1;m<month;m++){
            total+=getMonthDay(m,year);
        }
        total+=day;
        return total;

    }
    public static boolean Is366(int year) {
        return year % 4 == 0;
    }
    public static int getMonthDay(int month,int year) {
        if(month==2){
            if(Is366(year)){
                return 29;
            }
            return 28;
        }
        if(month==1||month==3||month==5||month==7||month==8||month==10||month==12){
            return 31;
        }
        return 30;
    }

}
